/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bestco.bela.demo;

import com.bestco.bela.EntityClasses.Creditlevel;
import com.bestco.bela.EntityClasses.Login;
import com.bestco.bela.demo.exceptions.PreexistingEntityException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author bash
 */
public class DemoConsole {


    private static LoginJpaController control=new LoginJpaController();

    public static void main(String[] args) {
        List<Login> logins= new ArrayList<Login>();


        for(int i=1;i<=4;i++){

          Login l=  new Login("bash"+i,"une"+i,new Creditlevel(Integer.valueOf(i)));
           //logins.add(l);
           try {
                control.create(l);
            } catch (PreexistingEntityException ex) {
                System.err.println("ce login existe déjà");
            } catch (Exception ex) {
               ex.printStackTrace();
            }
        }
    }

}
